﻿using UnityEngine;

namespace UnityView
{
    public struct UIRect
    {
        public Vector2 Min;
        public Vector2 Max;

        public UIRect(float minX, float maxX, float minY, float maxY)
        {
            Min = new Vector2(minX, minY);
            Max = new Vector2(maxX, maxY);
        }

        public static UIRect Center(float width, float height)
        {
            return new UIRect((UIConstant.DesignWidth - width) * 0.5f, (UIConstant.DesignHeight - height) * 0.5f, width, height);
        }

        // public override string ToString()
        // {
        //     return
        //         new StringBuilder("( ").Append(Left)
        //             .Append(", ")
        //             .Append(Top)
        //             .Append(", ")
        //             .Append(Width)
        //             .Append(", ")
        //             .Append(Height)
        //             .Append(" )")
        //             .ToString();
        // }
    }
}
